from urllib import response

from scrapy.selector import Selector
from scrapy.http import HtmlResponse
from w3lib import url

text = '<html><body><span><testdemo></span></body></html>'
Selector(text=text).xpath('//span/text()').extract()
[u'testdemo']
data_response = HtmlResponse(url=url, body=text)
Selector(response=data_response).xpath('//span/text()').extract()
[u'testdemo']
response.selector.xpath('//span/text()').extract()
[u'testdemo']
